﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WF_QLThuVien.Entities;
using WF_QLThuVien.DataLayer;

namespace WF_QLThuVien.BusinessLayer
{
    public class CBLL_Login
    {
        CDAL_Login dalLogin = new CDAL_Login();

        public int CheckUser(CLogin li)
        {
            CLogin login = dalLogin.LoadUser();
            if (login != null)
            {
                if (login.User.ToUpper().Equals(li.User.ToUpper()) && login.Pass.Equals(li.Pass))
                {
                    return 1;//có acc
                }

                return 2;//chưa có acc trong db
            }
            else
            {
                return 3;//db trống
            }
        }

        public bool Update(CLogin li)
        {
            return dalLogin.Update(li);
        }
    }
}
